package com.ruoyi.control.service.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.control.mapper.DchjsFiveMapper;
import com.ruoyi.control.domain.DchjsFive;
import com.ruoyi.control.service.IDchjsFiveService;

/**
 * 10605底抽巷局扇Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class DchjsFiveServiceImpl extends ServiceImpl<DchjsFiveMapper, DchjsFive> implements IDchjsFiveService //修改
{
    @Autowired
    private DchjsFiveMapper dchjsFiveMapper;

    /**
     * 查询10605底抽巷局扇
     * 
     * @param tagName 10605底抽巷局扇主键
     * @return 10605底抽巷局扇
     */
    @Override
    public DchjsFive selectDchjsFiveByTagName(String tagName)
    {
        return dchjsFiveMapper.selectDchjsFiveByTagName(tagName);
    }

    /**
     * 查询10605底抽巷局扇列表
     * 
     * @param dchjsFive 10605底抽巷局扇
     * @return 10605底抽巷局扇
     */
    @Override
    public List<DchjsFive> selectDchjsFiveList(DchjsFive dchjsFive)
    {
        return dchjsFiveMapper.selectDchjsFiveList(dchjsFive);
    }

    /**
     * 新增10605底抽巷局扇
     * 
     * @param dchjsFive 10605底抽巷局扇
     * @return 结果
     */
    @Override
    public int insertDchjsFive(DchjsFive dchjsFive)
    {
        return dchjsFiveMapper.insertDchjsFive(dchjsFive);
    }

    /**
     * 修改10605底抽巷局扇
     * 
     * @param dchjsFive 10605底抽巷局扇
     * @return 结果
     */
    @Override
    public int updateDchjsFive(DchjsFive dchjsFive)
    {
        dchjsFive.setUpdateTime(DateUtils.getNowDate());
        return dchjsFiveMapper.updateDchjsFive(dchjsFive);
    }

    /**
     * 批量删除10605底抽巷局扇
     * 
     * @param tagNames 需要删除的10605底抽巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteDchjsFiveByTagNames(String[] tagNames)
    {
        return dchjsFiveMapper.deleteDchjsFiveByTagNames(tagNames);
    }

    /**
     * 删除10605底抽巷局扇信息
     * 
     * @param tagName 10605底抽巷局扇主键
     * @return 结果
     */
    @Override
    public int deleteDchjsFiveByTagName(String tagName)
    {
        return dchjsFiveMapper.deleteDchjsFiveByTagName(tagName);
    }
    /**
     * 查询前端显示数据
     * @return
     */
    @Override
    public List<DchjsFive> getList() {
        List<DchjsFive> dchjsFiveList = new ArrayList<>();
        List<String> fanData = Arrays.asList("JKMS","JXMS","YKMS","ZJDY","ZJYJDJDY","ZJEJDJDY","YTJWZ","ZJDJWD","FL","FS","BJDY","BJDJWD","BJYJDJDY","BJEJDJDY","JDJWZ");
        for (String fanDatum : fanData) {
            DchjsFive dchjsFive = dchjsFiveMapper.selectDchjsFiveByTagName(fanDatum);
            dchjsFiveList.add(dchjsFive);
        }
        return dchjsFiveList;
    }
}
